Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Making sure the right RocksDB native binary is added for container build #2794

Merged
merged 1 commit into from
Jun 16, 2019

Conversation

gunnarmorling
Copy link
Contributor

@gunnarmorling gunnarmorling commented Jun 11, 2019

Fix #2663.

@gsmet, @cescoffier, a small follow-up to the Kafka Streams work. The wrong native binary for RocksDB ended up being added to the application image when doing a build targeting containers but running on macOS.

@gunnarmorling
Copy link
Contributor Author

@cescoffier, could you add me to the right team so I can "request a review" by you?

@cescoffier
Copy link
Member

@gunnarmorling You need to ask @gsmet. I don't have enough karma for this.

@cescoffier cescoffier self-requested a review June 12, 2019 06:33
Copy link
Member

@cescoffier cescoffier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've made a few comments.

This PR opens an interesting question about container builds. It does not have to be tackled in this PR, but something to follow up.

@@ -56,7 +56,19 @@ void build(RecorderContext recorder,
reflectiveClasses.produce(new ReflectiveClassBuildItem(true, false, false, ByteArraySerde.class));
reflectiveClasses.produce(new ReflectiveClassBuildItem(true, false, false, FailOnInvalidTimestamp.class));

nativeLibs.produce(new SubstrateResourceBuildItem(Environment.getJniLibraryFileName("rocksdb")));
// for RocksDB, either add linux64 native lib when targeting containers
String containerRuntime = System.getProperty("native-image.container-runtime");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not the only flag. You need to check for -Dnative-image.docker-build too

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gsmet @dmlloyd @stuartwdouglas Maybe we need a flag as we have for modes. WDYT?

Copy link
Contributor Author

@gunnarmorling gunnarmorling Jun 12, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I didn't feel happy about this specific solution. I'll add the check for the other property, too, as you suggested (btw. why do they both exist, there seems to be some overlap?

Would be great to have this information in a more accessible way. Perhaps it could be exposed via something like RecorderContext#getTargetPlatform(), returning an enum of possible platforms?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't make sense for RecorderContext, which relates to bytecode generation.

I think maybe we should have a NativeImageSetupBuildItem which contains information about the native image configuration. Then you could have a separate build step which consumes that and produces the substrate resource build item. If the step produces nothing else, it won't even run if there's no native image being produced.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've logged #2827 for adding an PI which makes that information accessible to extensions.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reworked this commit to also check -Dnative-image.docker-build.

@cescoffier cescoffier changed the title #2663 Making sure the right RocksDB native binary is added when doing… Making sure the right RocksDB native binary is added for container build Jun 12, 2019
@cescoffier cescoffier added this to the 0.17.0 milestone Jun 12, 2019
@cescoffier cescoffier added the kind/enhancement New feature or request label Jun 12, 2019
@gunnarmorling
Copy link
Contributor Author

@cescoffier Reworked to address your remark on the system properties. I think this was the only blocker; is there anything else in the way of merging this? Thanks!

@cescoffier
Copy link
Member

@gunnarmorling You need to apply the formatting rules, the CI is complaining.

Running mvn process-sources should fix it.

@gunnarmorling
Copy link
Contributor Author

Gasp. Pushed an update.

@gunnarmorling
Copy link
Contributor Author

@cescoffier The test failure looks unrelated AFAICS.

@cescoffier
Copy link
Member

@gunnarmorling Yes, the test failure in a race condition in the rest client tests. It should have been fixed in #2838 (by skipping the test...).

Can you rebase?

…hen doing in-container build;

Also ensuring KafkaProcessor runs when using kafka-streams extension.
@gunnarmorling
Copy link
Contributor Author

Can you rebase?

Done.

@cescoffier cescoffier merged commit 59c85e3 into quarkusio:master Jun 16, 2019
@cescoffier
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create Quarkus extension for Kafka Streams
3 participants